

#ifndef UC_GECURV3D_H
#define UC_GECURV3D_H

#include "zadesk.h"
#include "zgeent3d.h"
#include "zgeponc3d.h"
#include "zgept3dar.h"
#include "zgevc3dar.h"
#include "zgedblar.h"
#include "zgevptar.h"
#include "zgeintarr.h"
#pragma pack (push, 8)

class UcGeCurve2d;
class UcGeSurface;
class UcGePoint3d;
class UcGePlane;
class UcGeVector3d;
class UcGeLinearEnt3d;
class UcGeLine3d;
class UcGePointOnCurve3d;
class UcGePointOnSurface;
class UcGeInterval;
class UcGeMatrix3d;
class UcGePointOnCurve3dData;
class UcGeBoundBlock3d;

class
GE_DLLEXPIMPORT
UcGeCurve3d : public UcGeEntity3d
{
public:

    void           getInterval(UcGeInterval& intrvl) const;
    void           getInterval(UcGeInterval& intrvl, UcGePoint3d& start,
                               UcGePoint3d& end) const;
    UcGeCurve3d&   reverseParam();
	UcGeCurve3d&   setInterval();
	ZSoft::Boolean setInterval(const UcGeInterval& intrvl);

    double       distanceTo(const UcGePoint3d& pnt,
                            const UcGeTol& tol = UcGeContext::gTol) const;
    double       distanceTo(const UcGeCurve3d& curve,
                            const UcGeTol& tol = UcGeContext::gTol) const;

    UcGePoint3d closestPointTo(const UcGePoint3d& pnt,
                               const UcGeTol& tol = UcGeContext::gTol) const;
    UcGePoint3d closestPointTo(const UcGeCurve3d& curve3d,
                               UcGePoint3d& pntOnOtherCrv,
                               const UcGeTol& tol = UcGeContext::gTol) const;

    void getClosestPointTo(const UcGePoint3d& pnt, UcGePointOnCurve3d& pntOnCrv,
                           const UcGeTol& tol = UcGeContext::gTol) const;
    void getClosestPointTo(const UcGeCurve3d& curve3d,
                           UcGePointOnCurve3d& pntOnThisCrv,
                           UcGePointOnCurve3d& pntOnOtherCrv,
                           const UcGeTol& tol = UcGeContext::gTol) const;

    UcGePoint3d projClosestPointTo(const UcGePoint3d& pnt,
                                   const UcGeVector3d& projectDirection,
                                   const UcGeTol& tol = UcGeContext::gTol) const;
    UcGePoint3d projClosestPointTo(const UcGeCurve3d& curve3d,
                                   const UcGeVector3d& projectDirection,
                                   UcGePoint3d& pntOnOtherCrv,
                                   const UcGeTol& tol = UcGeContext::gTol) const;

    void getProjClosestPointTo(const UcGePoint3d& pnt,
                               const UcGeVector3d& projectDirection,
                               UcGePointOnCurve3d& pntOnCrv,
                               const UcGeTol& tol = UcGeContext::gTol) const;
    void getProjClosestPointTo(const UcGeCurve3d& curve3d,
                               const UcGeVector3d& projectDirection,
                               UcGePointOnCurve3d& pntOnThisCrv,
                               UcGePointOnCurve3d& pntOnOtherCrv,
                               const UcGeTol& tol = UcGeContext::gTol) const;

	ZSoft::Boolean getNormalPoint(const UcGePoint3d& pnt,
	                              UcGePointOnCurve3d& pntOnCrv,
                                      const UcGeTol& tol = UcGeContext::gTol) const;

    UcGeBoundBlock3d  boundBlock() const;
    UcGeBoundBlock3d  boundBlock(const UcGeInterval& range) const;

    UcGeBoundBlock3d  orthoBoundBlock() const;
    UcGeBoundBlock3d  orthoBoundBlock(const UcGeInterval& range) const;

    UcGeEntity3d*  project(const UcGePlane& projectionPlane,
                           const UcGeVector3d& projectDirection,
                           const UcGeTol& tol = UcGeContext::gTol) const;
    UcGeEntity3d*  orthoProject(const UcGePlane& projectionPlane,
                                const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean isOn(const UcGePoint3d& pnt,
                        const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isOn(const UcGePoint3d& pnt, double& param,
                        const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isOn(double param,
                        const UcGeTol& tol = UcGeContext::gTol) const;

    double paramOf(const UcGePoint3d& pnt, const UcGeTol& tol = UcGeContext::gTol)const;

	void getTrimmedOffset(double distance,
		              const UcGeVector3d& planeNormal,
			      UcGeVoidPointerArray& offsetCurveList,
			      UcGe::OffsetCrvExtType extensionType = UcGe::kFillet,
                              const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean isClosed      (const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isPlanar      (UcGePlane& plane,
                                  const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isLinear      (UcGeLine3d& line,
                                  const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isCoplanarWith(const UcGeCurve3d& curve3d,
                                  UcGePlane& plane,
                                  const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isPeriodic    (double& period) const;

    double         length       (double fromParam, double toParam,
                                 double tol = UcGeContext::gTol.equalPoint()) const;
    double         paramAtLength(double datumParam, double length,
                                 ZSoft::Boolean posParamDir = ZSoft::kTrue,
                                 double tol = UcGeContext::gTol.equalPoint()) const;
    ZSoft::Boolean area         (double startParam, double endParam,
                                 double& value,
                                 const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean isDegenerate(UcGe::EntityId& degenerateType,
                                const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isDegenerate(UcGeEntity3d*& pConvertedEntity,
                                const UcGeTol& tol = UcGeContext::gTol) const;

    void getSplitCurves(double param, UcGeCurve3d* & piece1,
                        UcGeCurve3d* & piece2) const;

	ZSoft::Boolean explode       (UcGeVoidPointerArray& explodedCurves,
	                              UcGeIntArray& newExplodedCurves,
				      const UcGeInterval* intrvl = NULL ) const;

    void getLocalClosestPoints(const UcGePoint3d& point,
                               UcGePointOnCurve3d& approxPnt,
                               const UcGeInterval* nbhd = 0,
                               const UcGeTol& tol = UcGeContext::gTol) const;
    void getLocalClosestPoints(const UcGeCurve3d& otherCurve,
                               UcGePointOnCurve3d& approxPntOnThisCrv,
                               UcGePointOnCurve3d& approxPntOnOtherCrv,
                               const UcGeInterval* nbhd1 = 0,
                               const UcGeInterval* nbhd2 = 0,
                               const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean hasStartPoint(UcGePoint3d& startPnt) const;
    ZSoft::Boolean hasEndPoint  (UcGePoint3d& endPnt) const;

    UcGePoint3d    evalPoint(double param) const;
    UcGePoint3d    evalPoint(double param, int numDeriv,
                             UcGeVector3dArray& derivArray) const;

    void           getSamplePoints(double fromParam, double toParam,
                                   double approxEps, UcGePoint3dArray& 
 		                   pointArray, UcGeDoubleArray& paramArray) const;
    void           getSamplePoints(int numSample, UcGePoint3dArray& pointArray) const;
	void           getSamplePoints(int numSample, UcGePoint3dArray& pointArray, UcGeDoubleArray& paramArray) const;

    UcGeCurve3d&   operator =  (const UcGeCurve3d& curve);

protected:

    UcGeCurve3d();
    UcGeCurve3d(const UcGeCurve3d&);
};

#pragma pack (pop)
#endif
